# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=igmpproxy
pkgver=0.2.1
pkgrel=0
pkgdesc="A simple dynamic Multicast Routing Daemon using only IGMP signalling"
url="https://sourceforge.net/projects/igmpproxy/"
arch="all"
license="GPL-2.0-or-later"
makedepends="linux-headers"
subpackages="$pkgname-doc"
source="https://github.com/pali/igmpproxy/releases/download/$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	# our kernel have a patch that changes MAXVIFS
	# note that this is ABI incompatible
	sed -i -e 's:^#define MAX_MC_VIFS.*:#define MAX_MC_VIFS   MAXVIFS:' \
		src/igmpproxy.h

	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="17f6891bf49d3e70cdf3930ab1abe6a0ad7b9f12ff2d1cdde3761771988585301f459995ba5ea956c742597de4ce13fbf0ba3c1ae37d13b2eee2a09f16f51ae2  igmpproxy-0.2.1.tar.gz"
